# -*- encoding: utf-8 -*-
"""
@Project : AIGateWay 
@FileName: tronado_gateway
@Time    : 2020/11/26 14:55
@Author  : chenych
@Desc    :
"""
import sys
import os


sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from Service.SmartHome.strange_recognition_handler import StrangeRecoHandler, StrangeRecoItem
from Service.SmartHome.camer_inspection_handler import CameraInspHandler,CameraInspItem
from Service.SmartHome.face_deletion_handler import FaceDeletHandle,FaceDeletItem


import uvicorn
from Core import conf
from Service import app

url_StrangeReco = conf.get('gateway_url', 'url_StrangeReco')
url_FaceDelet = conf.get('gateway_url', 'url_FaceDelet')
url_CameraInsp = conf.get('gateway_url', 'url_CameraInsp')



@app.post(url_StrangeReco)
async def strangeRecoHandler(item: StrangeRecoItem):
    return await StrangeRecoHandler.post(item)

@app.post(url_CameraInsp)
async def cameraInspHandler(item: CameraInspItem):
    return await CameraInspHandler.post(item)

@app.post(url_FaceDelet)
async def faceDeletHandle(item: FaceDeletItem):
    return await FaceDeletHandle.post(item)


if __name__ == '__main__':
    uvicorn.run(app, host="0.0.0.0", port=6000)
